//引入express
let express = require('express');
let router = express.Router();
//引入mongoose
let mongoose = require('mongoose');


// 页面渲染
router.get("/type",async function(req,resp){
    let typeObj = await mongoose.model('indexModel').find({});
    // console.log(typeObj);
    resp.send({
        code:1,
        message:`查询成功`,
        data:typeObj
    });
});





//暴露
module.exports = router;